package com.mybatis.utils;

import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.InputStream;

/**
 * ClassName: SqlSessionFactoryUtils
 * Package: com.mybatis.utils
 * Description:
 *
 * @Author 刘英杰
 * @Create 2024/11/11 20:45
 * @Version 1.0
 */
public class SqlSessionFactoryUtils {
    /*不允许外部创建对象*/
    private SqlSessionFactoryUtils() {
    }

    public static SqlSessionFactory generateSqlSessionFactory() {
        InputStream is = SqlSessionFactoryUtils.class.getClassLoader().getResourceAsStream("SqlMapConfig.xml");
        return new SqlSessionFactoryBuilder().build(is);
    }

}
